package com.dys.designpattern.builder.commander;

import com.dys.designpattern.builder.creater.Builder;
import com.dys.designpattern.builder.product.Bike;

/**
 * @Author: 疾风
 * @ClassName: Director
 * @Description: 指挥者
 * @CreateDate: 2024/05/28
 * @Version: v1.0.0
 */
public class Director {
    /**
     * 持有抽象建造者对象
     */
    private final Builder BUILDER;

    public Director(Builder builder) {
        this.BUILDER = builder;
    }

    public Bike construct() {
        BUILDER.buildFrame();
        BUILDER.buildSeat();
        return BUILDER.createBike();
    }
}
